<article id="wikiArticle">
<div>
<div> <div class="blockIndicator nonStandard nonStandardHeader">
<p><strong><span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span> 非标准</strong><br/>
      该特性是非标准的，请尽量不要在生产环境中使用它！</p>
</div></div>
</div>
<h2 id="Summary" name="Summary">概述</h2>
<p>返回函数的源代码的字符串表示.</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre><code class="language-javascript"><code><var>function</var>.toSource();
Function.toSource();
</code></code></pre>
<h3 id="Parameters" name="Parameters">参数</h3>
<p>无</p>
<h2 id="Description" name="Description">描述</h2>
<p><code>toSource方法返回下面的值</code>:</p>
<p></p>
<ul>
<li>对于内置的<code>Function</code>对象,<code>toSource</code>返回下面的字符串:</li>
</ul>
<pre><code  class="language-javascript"><code>function Function() {
    [native code]
}</code></code></pre>
<ul>
<li>对于自定义函数来说, <code>toSource返回能定义该函数</code>的Javascript源码.</li>
</ul>
<p>该方法通常在引擎内部调用.你可以在调试的时候用该方法开查看一个函数的源代码.</p>
<h2 id="See_Also" name="See_Also">相关链接</h2>
<ul>
<li><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Function/toString" title="JavaScript/Reference/Global_Objects/Function/toString">toString</a></li>
<li><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Object/valueOf" title="JavaScript/Reference/Global_Objects/Object/valueOf">Object.prototype.valueOf</a></li>
</ul>
</article>